Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / androidApp / src / google / kotlin / org / meshtastic / app / map / component / CustomTileProviderManagerSheet.kt

Displaying Raw • Download

androidApp/src/google/kotlin/org/meshtastic/app/map/component/CustomTileProviderManagerSheet.kt 7730823aad5ffe461199820be209e18d09b0ee07 (7730823a) Text, 2.70 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map.component

Tff7b72import T7ee787android.app.Activity
Tff7b72import T7ee787android.content.Intent
Tff7b72import T7ee787androidx.activity.compose.rememberLauncherForActivityResult
Tff7b72import T7ee787androidx.activity.result.contract.ActivityResultContracts
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.LaunchedEffect
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.compose.ui.platform.LocalContext
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787kotlinx.coroutines.flow.collectLatest
Tff7b72import T7ee787org.meshtastic.app.map.MapViewModel
Tff7b72import T7ee787org.meshtastic.app.map.getFileName
Tff7b72import T7ee787org.meshtastic.core.ui.util.showToast

Tf0883e@Composable
Tff7b72fun Td2a8ffCustomTileProviderManagerSheetTb4b4b4(Te6edf3mapViewModelTb4b4b4: Te6edf3MapViewModelTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3providers Tff7b72by Te6edf3mapViewModelTb4b4b4.Te6edf3customTileProviderConfigsTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3context Tff7b72= Te6edf3LocalContextTb4b4b4.Te6edf3current
Tff7b72val Te6edf3mbtilesPickerLauncher Tff7b72=
Te6edf3rememberLauncherForActivityResultTb4b4b4(Te6edf3contract Tff7b72= Te6edf3ActivityResultContractsTb4b4b4.Te6edf3StartActivityForResultTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{ Te6edf3result Tff7b72-Tff7b72>
Tff7b72if Tb4b4b4(Te6edf3resultTb4b4b4.Te6edf3resultCode Tff7b72=Tff7b72= Te6edf3ActivityTb4b4b4.Te6edf3RESULT_OKTb4b4b4) Tb4b4b4{
Te6edf3resultTb4b4b4.Te6edf3dataTff7b72?.Te6edf3dataTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3uri Tff7b72-Tff7b72>
Te6edf3mapViewModelTb4b4b4.Te6edf3addCustomTileProviderTb4b4b4(
Te6edf3name Tff7b72= Te6edf3uriTb4b4b4.Te6edf3getFileNameTb4b4b4(Te6edf3contextTb4b4b4)Tb4b4b4.Te6edf3substringBeforeLastTb4b4b4(Ta5d6ff'.'Tb4b4b4)Tb4b4b4,
Te6edf3urlTemplate Tff7b72= Ta5d6ff"Ta5d6ff"Tb4b4b4,
Te6edf3localUri Tff7b72= Te6edf3uriTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

Te6edf3LaunchedEffectTb4b4b4(Tffa657UnitTb4b4b4) Tb4b4b4{ Te6edf3mapViewModelTb4b4b4.Te6edf3errorFlowTb4b4b4.Te6edf3collectLatest Tb4b4b4{ Te6edf3contextTb4b4b4.Te6edf3showToastTb4b4b4(Tffa657itTb4b4b4) Tb4b4b4} Tb4b4b4}

Te6edf3CustomTileProviderManagerTb4b4b4(
Te6edf3providers Tff7b72= Te6edf3providersTb4b4b4,
Te6edf3onAdd Tff7b72= Te6edf3mapViewModelTff7b72::Te6edf3addCustomTileProviderTb4b4b4,
Te6edf3onUpdate Tff7b72= Te6edf3mapViewModelTff7b72::Te6edf3updateCustomTileProviderTb4b4b4,
Te6edf3onDelete Tff7b72= Te6edf3mapViewModelTff7b72::Te6edf3removeCustomTileProviderTb4b4b4,
Te6edf3onAddLocalMbTiles Tff7b72= Tb4b4b4{
Te6edf3mbtilesPickerLauncherTb4b4b4.Te6edf3launchTb4b4b4(
Te6edf3IntentTb4b4b4(Te6edf3IntentTb4b4b4.Te6edf3ACTION_OPEN_DOCUMENTTb4b4b4)Tb4b4b4.Te6edf3apply Tb4b4b4{
Te6edf3addCategoryTb4b4b4(Te6edf3IntentTb4b4b4.Te6edf3CATEGORY_OPENABLETb4b4b4)
Te6edf3type Tff7b72= Ta5d6ff"Ta5d6ff*/*Ta5d6ff"
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.08s